<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>身份证查看</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link rel="stylesheet" href="__PUBLIC__/common/css/lightbox.css">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-4">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>银行卡正面</h5>
                </div>
                <div  class="ibox-content">
                    <a  class="example-image-link" href="__ROOT__/{$data.front_img}" data-lightbox="example-1" data-title="身份证正面">
                        <img class="example-image" src="__ROOT__/{$data.front_img}" alt="image-1" style="width: 100%;height: 100%;"/>
                    </a>
                </div>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>身份证正面</h5>
                </div>
                <div class="ibox-content">
                    <a class="example-image-link" href="__ROOT__/{$data.behind_img}" data-lightbox="example-1" data-title="身份证正面">
                        <img class="example-image" src="__ROOT__/{$data.behind_img}" alt="image-1" style="width: 100%;height: 100%;"/>
                    </a>
                </div>
            </div>
        </div>
        <div class="col-sm-4">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>身份证背面</h5>
                </div>
                <div class="ibox-content">
                    <a  class="example-image-link" href="__ROOT__/{$data.hand_img}" data-lightbox="example-1" data-title="银行卡正面">
                        <img class="example-image" src="__ROOT__/{$data.hand_img}" alt="image-1" style="width: 100%;height: 100%;"/>
                    </a>
                </div>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-3 col-sm-8">
            <button  class="btn btn-sm btn-info" type="button"><a href="__MODULE__/Apply/examineList"> 返回</a></button>
            <if condition="$data.status eq 2">
                <button style="margin-left: 80px;" data-toggle="modal" onclick="Examine_agree(this,'{$data.user_id}')" class="btn btn-success">审核通过</button>
                <button style="margin-left: 80px;" data-toggle="modal" class="btn btn-danger" href="intoGold_OneData.html#modal-form">拒绝文档</button>
            </if>
        </div>
    </div>
</div>

<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12 b-r">
                        <h3 class="m-t-none m-b">请填写拒绝理由</h3>
                        <form role="form">
                            <div class="form-group">
                                <label>拒绝理由：</label>
                                <input type="text" id="refuse" class="form-control" />
                            </div>

                            <div>
                                <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="button" onclick="Examine_refuse(this,'{$data.user_id}');"><strong>确认</strong>
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->
<script src="__PUBLIC__/admin/js/plugins/peity/jquery.peity.min.js"></script>
<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/common/js/layer_show.js"></script>
<script src="__PUBLIC__/common/js/lightbox-plus-jquery.min.js"></script>

<script type="text/javascript">
    //同意通过
    function Examine_agree(obj,id){
        if(id==''){
            layer.msg('信息获取失败，请刷新页面再试');
            return false;
        }
        var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
        $.ajax({
            type:"POST",
            url:"__MODULE__/User/examine",
            dataType:'json',
            data:{id:id,type:3},
            success:function(data){
                //alert(JSON.stringify(data));return;
                layer.close(index);
                if(data.status==1){
                    layer.msg(data.msg);
                    setTimeout(function () {location.reload();}, 1000);
                }else if(data.status==0){
                    layer.msg(data.msg,{icon: 2, time: 2000});
                }else{
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            },error:function(err){
                //console.log(err);
                layer.close(index);
                layer.msg('网络错误',{icon: 2, time: 2000});
            }
        });

    }

    //文件拒绝
    function Examine_refuse(obj,id) {
        var refuse = $("#refuse").val();
        if(id==''||refuse==''){
            layer.msg('信息获取失败，请刷新页面再试');
            return false;
        }else{
            var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
            $.ajax({
                type:"POST",
                url:"__MODULE__/User/examine",
                dataType:'json',
                data:{id:id,type:4,reason:refuse},
                success:function(data){
                    //alert(JSON.stringify(data));return;
                    layer.close(index);
                    if(data.status==1){
                        layer.msg(data.msg);
                        setTimeout(function () {location.reload();}, 1000);
                    }else if(data.status==0){
                        layer.msg(data.msg,{icon: 2, time: 2000});
                    }else{
                        layer.msg('网络错误',{icon: 2, time: 2000});
                    }
                },error:function(err){
                    //console.log(err);
                    layer.close(index);
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            });
        }
    }
</script>
</body>
</html>
